* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  background: #f3f6fb;
  color: #1f2937;
}

.container {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 16px;
}

.card {
  width: 100%;
  max-width: 380px;
  padding: 24px;
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
}

.title {
  margin: 0 0 8px;
  font-size: 24px;
  text-align: center;
}

.subtitle {
  margin: 0 0 20px;
  color: #6b7280;
  text-align: center;
  font-size: 14px;
}

.label {
  display: block;
  margin: 10px 0 6px;
  font-size: 14px;
}

input {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

input:focus {
  border-color: #2563eb;
}

button {
  width: 100%;
  margin-top: 16px;
  height: 42px;
  border: 0;
  border-radius: 8px;
  background: #2563eb;
  color: #ffffff;
  font-size: 15px;
  cursor: pointer;
  transition: background 0.2s;
}

button:hover {
  background: #1d4ed8;
}

button:disabled {
  background: #93c5fd;
  cursor: not-allowed;
}

.message {
  margin: 12px 0 0;
  min-height: 20px;
  text-align: center;
  font-size: 14px;
}

.message.success {
  color: #059669;
}

.message.error {
  color: #dc2626;
}

.success-card {
  text-align: center;
}

.link-button {
  display: inline-block;
  margin-top: 8px;
  padding: 10px 18px;
  border-radius: 8px;
  background: #2563eb;
  color: #ffffff;
  text-decoration: none;
  font-size: 14px;
}

.link-button:hover {
  background: #1d4ed8;
}

.top-bar {
  width: 100%;
  display: flex;
  align-items: center;
  padding: 12px 16px;
  gap: 12px;
}

.top-bar .link-button {
  margin-top: 0;
}

button.link-button {
  border: none;
  cursor: pointer;
  font: inherit;
}

.top-right {
  margin-top: 0;
  margin-left: auto;
}

.data-page {
  width: 100%;
  padding: 0 16px 20px;
}

.dashboard-layout {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 16px;
}

.side-menu {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
  padding: 12px;
  display: grid;
  gap: 8px;
  align-content: start;
  position: sticky;
  top: 12px;
  height: fit-content;
}

.menu-btn {
  display: block;
  text-align: center;
  padding: 10px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  color: #334155;
  text-decoration: none;
  background: #ffffff;
  font-size: 14px;
  line-height: 1.2;
  white-space: nowrap;
}

.menu-btn:hover {
  border-color: #3b82f6;
  color: #1d4ed8;
  background: #eff6ff;
}

.menu-btn.active {
  border-color: #2563eb;
  color: #ffffff;
  background: #2563eb;
}

.data-wrap {
  width: 100%;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
  padding: 18px;
  min-width: 0;
}

.users-container {
  width: 100%;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid #dbe3ef;
  border-radius: 10px;
  background: #ffffff;
}

.users-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

.users-table th,
.users-table td {
  border: 1px solid #e2e8f0;
  padding: 10px 8px;
  text-align: center;
  vertical-align: middle;
  font-size: 14px;
  color: #111827;
}

.users-table th {
  background: #f1f5f9;
  color: #1e293b;
  font-weight: 600;
}

.users-table tbody tr:nth-child(even) {
  background: #f8fafc;
}

.table-cell {
  word-break: break-all;
}

.avatar-preview {
  max-width: 60px;
  max-height: 60px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
}

.avatar-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.avatar-placeholder {
  width: 60px;
  height: 60px;
  border-radius: 8px;
  border: 1px dashed #94a3b8;
  background: #f8fafc;
  color: #64748b;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.avatar-placeholder-svg {
  width: 60px;
  height: 60px;
  border: 1px dashed #94a3b8;
}

.avatar-placeholder-text {
  position: absolute;
  bottom: 2px;
  left: 0;
  width: 100%;
  text-align: center;
  font-size: 11px;
  color: #475569;
  background: rgba(255, 255, 255, 0.85);
}

.empty-tip {
  margin: 0;
  color: #64748b;
  text-align: center;
  padding: 16px;
}

.pagination {
  margin-top: 12px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.page-btn {
  min-width: 88px;
  height: 34px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #ffffff;
  color: #1e293b;
  cursor: pointer;
}

.page-btn:hover:not(:disabled) {
  border-color: #3b82f6;
  color: #1d4ed8;
}

.page-btn:disabled {
  cursor: not-allowed;
  color: #94a3b8;
  background: #f8fafc;
}

.page-info {
  font-size: 13px;
  color: #475569;
}

.edit-coins-btn {
  width: auto;
  margin-top: 0;
  margin-right: 6px;
  height: 32px;
  padding: 0 10px;
  border-radius: 6px;
  border: 1px solid #3b82f6;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 13px;
  cursor: pointer;
}

.edit-coins-btn:hover {
  background: #dbeafe;
}

.edit-gems-btn {
  width: auto;
  margin-top: 0;
  margin-right: 6px;
  height: 32px;
  padding: 0 10px;
  border-radius: 6px;
  border: 1px solid #7c3aed;
  background: #f5f3ff;
  color: #6d28d9;
  font-size: 13px;
  cursor: pointer;
}

.edit-gems-btn:hover {
  background: #ede9fe;
}

.edit-lv-btn {
  width: auto;
  margin-top: 0;
  height: 32px;
  padding: 0 10px;
  border-radius: 6px;
  border: 1px solid #16a34a;
  background: #f0fdf4;
  color: #15803d;
  font-size: 13px;
  cursor: pointer;
}

.edit-lv-btn:hover {
  background: #dcfce7;
}

.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-card {
  width: 92%;
  max-width: 360px;
  background: #ffffff;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.2);
  padding: 18px;
}

.modal-title {
  margin: 0;
  font-size: 18px;
  color: #0f172a;
}

.modal-tip {
  margin: 10px 0 10px;
  color: #64748b;
  font-size: 13px;
}

.modal-input {
  width: 100%;
  height: 40px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 0 10px;
  font-size: 14px;
}

.modal-input:focus {
  border-color: #2563eb;
}

.modal-textarea {
  width: 100%;
  min-height: 120px;
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  line-height: 1.5;
  resize: vertical;
  outline: none;
}

.modal-textarea:focus {
  border-color: #2563eb;
}

.modal-card.modal-card--message {
  max-width: 480px;
}

.msg-edit-btn,
.session-edit-btn {
  width: auto;
  margin-top: 0;
  height: 32px;
  padding: 0 12px;
  border-radius: 6px;
  border: 1px solid #0ea5e9;
  background: #f0f9ff;
  color: #0369a1;
  font-size: 13px;
  cursor: pointer;
}

.msg-edit-btn:hover,
.session-edit-btn:hover {
  background: #e0f2fe;
}

.manager-toolbar {
  margin: 0 0 14px;
}

.manager-toolbar .link-button {
  margin-top: 0;
}

.manager-delete-btn {
  margin-left: 8px;
  width: auto;
  height: 32px;
  padding: 0 12px;
  border-radius: 6px;
  border: 1px solid #f87171;
  background: #fef2f2;
  color: #b91c1c;
  font-size: 13px;
  cursor: pointer;
}

.manager-delete-btn:hover {
  background: #fee2e2;
}

.table-actions-col {
  white-space: nowrap;
  width: 1%;
}

.table-actions-col .msg-edit-btn,
.table-actions-col .session-edit-btn,
.table-actions-col .manager-delete-btn,
.table-actions-col .edit-coins-btn,
.table-actions-col .edit-gems-btn,
.table-actions-col .edit-lv-btn {
  margin-bottom: 6px;
}

.table-actions-col .msg-edit-btn:last-child,
.table-actions-col .session-edit-btn:last-child,
.table-actions-col .manager-delete-btn:last-child,
.table-actions-col .edit-coins-btn:last-child,
.table-actions-col .edit-gems-btn:last-child,
.table-actions-col .edit-lv-btn:last-child {
  margin-bottom: 0;
}

.modal-message {
  min-height: 20px;
  margin: 8px 0 0;
  color: #dc2626;
  font-size: 13px;
}

.modal-actions {
  margin-top: 12px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.modal-btn {
  width: auto;
  margin-top: 0;
  height: 34px;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  background: #ffffff;
  color: #334155;
  padding: 0 12px;
}

.modal-btn.primary {
  border-color: #2563eb;
  background: #2563eb;
  color: #ffffff;
}

.modal-btn.primary:hover {
  background: #1d4ed8;
}

@media (max-width: 768px) {
  .top-bar {
    padding: 10px 12px;
  }

  .data-page {
    padding: 0 10px 14px;
  }

  .dashboard-layout {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .side-menu {
    position: static;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: center;
    gap: 6px;
    padding: 10px;
  }

  .menu-btn {
    padding: 9px 6px;
    font-size: 13px;
  }

  .data-wrap {
    padding: 12px;
  }

  .title {
    font-size: 20px;
  }

  .subtitle {
    font-size: 13px;
    margin-bottom: 12px;
  }

  .users-table {
    min-width: 640px;
  }

  .users-table th,
  .users-table td {
    font-size: 13px;
    padding: 8px 6px;
  }

  .table-actions-col .msg-edit-btn,
  .table-actions-col .session-edit-btn,
  .table-actions-col .manager-delete-btn,
  .table-actions-col .edit-coins-btn,
  .table-actions-col .edit-gems-btn,
  .table-actions-col .edit-lv-btn {
    height: 30px;
    padding: 0 8px;
    font-size: 12px;
    margin-right: 4px;
  }

  .modal-card {
    width: 96%;
    padding: 14px;
  }

  .modal-actions {
    justify-content: stretch;
  }

  .modal-btn {
    flex: 1;
  }
}

@media (max-width: 480px) {
  .side-menu {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .menu-btn {
    font-size: 12px;
  }

  .users-table {
    min-width: 560px;
  }
}
