﻿/* 游戏玩家查询库 - Trae主题 黑色+绿色 */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  background: #0a0e14;
  color: #c8d1d9;
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  color-scheme: dark;
}

/* ========== 全局滚动条 - 深色主题统一 ========== */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(0,255,136,0.25);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(0,255,136,0.45); }
/* Firefox */
* { scrollbar-width: thin; scrollbar-color: rgba(0,255,136,0.25) transparent; }

.bg-grid {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background-image:
    linear-gradient(rgba(0,255,136,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,255,136,0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
}
.bg-grid::before {
  content: '';
  position: absolute;
  top: -200px; right: -200px;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(0,255,136,0.08) 0%, transparent 70%);
  border-radius: 50%;
}
.bg-grid::after {
  content: '';
  position: absolute;
  bottom: -200px; left: -200px;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(0,180,255,0.06) 0%, transparent 70%);
  border-radius: 50%;
}
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  position: relative;
  z-index: 1;
}
.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0 30px;
  border-bottom: 1px solid rgba(0,255,136,0.15);
  margin-bottom: 25px;
}
.logo-area { display: flex; align-items: center; gap: 15px; }
.logo-icon {
  width: 56px; height: 56px;
  background: rgba(0,255,136,0.1);
  border: 1px solid rgba(0,255,136,0.3);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 20px rgba(0,255,136,0.2);
}
.logo-text h1 {
  font-size: 24px;
  color: #fff;
  letter-spacing: 2px;
  background: linear-gradient(90deg, #00ff88, #00bfff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.logo-text span { font-size: 11px; color: #5a6a7a; letter-spacing: 1px; }
.admin-link {
  color: #00ff88;
  text-decoration: none;
  font-size: 13px;
  padding: 8px 16px;
  border: 1px solid rgba(0,255,136,0.4);
  border-radius: 6px;
  transition: all 0.3s;
}
.admin-link:hover {
  background: rgba(0,255,136,0.15);
  box-shadow: 0 0 15px rgba(0,255,136,0.3);
}
.search-panel, .list-panel {
  background: rgba(20,28,40,0.8);
  border: 1px solid rgba(0,255,136,0.15);
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 20px;
  backdrop-filter: blur(10px);
  position: relative;
}
.search-panel { z-index: 2; }
.list-panel { z-index: 1; }
.panel-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  color: #00ff88;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(0,255,136,0.1);
}
.panel-title svg { flex-shrink: 0; }
.list-tip { font-size: 12px; color: #5a6a7a; margin-left: auto; font-weight: normal; }
.search-form { display: flex; flex-direction: column; gap: 15px; }
.form-row { display: flex; gap: 15px; flex-wrap: wrap; }
.form-group { display: flex; flex-direction: column; gap: 6px; min-width: 180px; position: relative; }
.form-group.grow { flex: 1; min-width: 250px; }
.form-group label { font-size: 13px; color: #8a9aa9; }

/* 原生select隐藏 */
.form-group select {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 1px;
  height: 1px;
}

/* 自定义下拉组件 */
.cs-select {
  position: relative;
  width: 100%;
  z-index: 10;
}
.cs-select.open { z-index: 999; }
.cs-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #0f1620;
  border: 1px solid rgba(0,255,136,0.25);
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 14px;
  color: #c8d1d9;
  cursor: pointer;
  transition: all 0.25s;
  user-select: none;
  font-family: inherit;
}
.cs-trigger:hover {
  border-color: rgba(0,255,136,0.5);
  background: #131c2a;
}
.cs-trigger .cs-text {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cs-trigger .cs-arrow {
  width: 14px; height: 14px;
  margin-left: 8px; flex-shrink: 0;
  transition: transform 0.25s;
}
.cs-trigger .cs-arrow svg {
  width: 100%; height: 100%;
  fill: none;
  stroke: #00ff88;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.cs-select.open .cs-trigger {
  border-color: #00ff88;
  box-shadow: 0 0 10px rgba(0,255,136,0.3);
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}
.cs-select.open .cs-arrow { transform: rotate(180deg); }
.cs-select.disabled .cs-trigger { opacity: 0.5; cursor: not-allowed; }

/* 下拉选项面板 */
.cs-dropdown {
  position: absolute;
  top: 100%; left: 0; right: 0;
  background: #0f1620;
  border: 1px solid #00ff88;
  border-top: none;
  border-bottom-left-radius: 6px;
  border-bottom-right-radius: 6px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5), 0 0 20px rgba(0,255,136,0.1);
  max-height: 240px;
  overflow-y: auto;
  z-index: 100;
  display: none;
  animation: csFadeIn 0.2s ease;
}
@keyframes csFadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
.cs-select.open .cs-dropdown { display: block; }
.cs-option {
  padding: 10px 14px;
  font-size: 14px;
  color: #c8d1d9;
  cursor: pointer;
  transition: all 0.15s;
  border-left: 2px solid transparent;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cs-option:hover {
  background: rgba(0,255,136,0.1);
  color: #00ff88;
  border-left-color: #00ff88;
}
.cs-option.selected {
  background: rgba(0,255,136,0.15);
  color: #00ff88;
  font-weight: bold;
  border-left-color: #00ff88;
}
.cs-option.empty {
  color: #5a6a7a;
  cursor: default;
  text-align: center;
  padding: 20px;
}
.cs-option.empty:hover { background: transparent; border-left-color: transparent; }

/* 输入框、文本域 */
.form-group input,
.form-group textarea {
  background: #0f1620;
  border: 1px solid rgba(0,255,136,0.25);
  color: #c8d1d9;
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 14px;
  outline: none;
  transition: all 0.3s;
  font-family: inherit;
}
.form-group input:focus,
.form-group textarea:focus {
  border-color: #00ff88;
  box-shadow: 0 0 8px rgba(0,255,136,0.3);
}
.form-group textarea { resize: vertical; min-height: 70px; }
.req { color: #ff5555; }

/* ========== 按钮 ========== */
.btn-search, .btn-add, .btn-submit {
  padding: 10px 24px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.3s;
  align-self: flex-end;
  font-family: inherit;
}
.btn-search {
  background: linear-gradient(135deg, #00ff88, #00b368);
  color: #0a0e14; font-weight: bold;
}
.btn-search svg { fill: #0a0e14; }
.btn-search:hover { box-shadow: 0 0 20px rgba(0,255,136,0.5); transform: translateY(-1px); }
.btn-add {
  background: rgba(0,255,136,0.1);
  color: #00ff88;
  border: 1px solid rgba(0,255,136,0.4);
}
.btn-add svg { fill: #00ff88; }
.btn-add:hover { background: rgba(0,255,136,0.2); }
.btn-submit {
  background: linear-gradient(135deg, #00ff88, #00b368);
  color: #0a0e14; font-weight: bold;
  width: 100%; justify-content: center; padding: 12px;
}
.btn-submit:hover { box-shadow: 0 0 20px rgba(0,255,136,0.5); }
.op-btn {
  padding: 5px 12px;
  border: 1px solid;
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.2s;
}
.op-remark { color: #00bfff; border-color: rgba(0,191,255,0.4); }
.op-remark:hover { background: rgba(0,191,255,0.15); }
.op-history { color: #ffa500; border-color: rgba(255,165,0,0.4); }
.op-history:hover { background: rgba(255,165,0,0.15); }
.op-apply { color: #00ff88; border-color: rgba(0,255,136,0.4); }
.op-apply:hover { background: rgba(0,255,136,0.15); }

/* 表格 */
.table-wrap { overflow-x: auto; }
.player-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.player-table th {
  background: rgba(0,255,136,0.08);
  color: #00ff88;
  padding: 12px 10px;
  text-align: left;
  font-weight: normal;
  border-bottom: 1px solid rgba(0,255,136,0.2);
  white-space: nowrap;
}
.player-table td {
  padding: 12px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  color: #b8c4d0;
}
.player-table tbody tr:hover { background: rgba(0,255,136,0.05); }
.player-table .name { color: #fff; font-weight: bold; }
.player-table .uid { color: #00bfff; font-family: monospace; }
.player-table .empty { text-align: center; color: #5a6a7a; padding: 40px; }
.ops { display: flex; gap: 6px; flex-wrap: wrap; }

/* 弹窗 */
.modal-mask {
  display: none;
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.7);
  z-index: 1000;
  align-items: center; justify-content: center;
  padding: 20px;
}
.modal-mask.show { display: flex; }
.modal {
  background: #141c28;
  border: 1px solid rgba(0,255,136,0.3);
  border-radius: 10px;
  width: 100%;
  max-width: 560px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 40px rgba(0,255,136,0.15);
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(0,255,136,0.15);
  color: #00ff88;
  font-size: 16px;
}
.modal-close {
  background: none; border: none; color: #8a9aa9;
  font-size: 24px; cursor: pointer; line-height: 1;
}
.modal-close:hover { color: #ff5555; }
.modal-body { padding: 20px; overflow-y: auto; }
.modal-form { display: flex; flex-direction: column; gap: 15px; }
.modal-form .form-group { min-width: 0; }
.form-actions { margin-top: 5px; }

.remark-box {
  background: #0f1620;
  border: 1px solid rgba(0,255,136,0.15);
  border-radius: 6px;
  padding: 15px;
  line-height: 1.8;
  color: #c8d1d9;
  white-space: pre-wrap;
  word-break: break-all;
}
.history-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.history-table th { background: rgba(0,255,136,0.08); color: #00ff88; padding: 10px; text-align: left; }
.history-table td { padding: 10px; border-bottom: 1px solid rgba(255,255,255,0.05); }
.history-table .empty { text-align: center; color: #5a6a7a; }

/* 响应式 */
@media (max-width: 768px) {
  .container { padding: 12px; }
  .site-header { flex-direction: column; gap: 15px; align-items: flex-start; }
  .form-row { flex-direction: column; }
  .form-group { width: 100%; min-width: 0; }
  .btn-search, .btn-add { align-self: stretch; justify-content: center; }
  .player-table th, .player-table td { padding: 8px 6px; font-size: 12px; }
  .logo-text h1 { font-size: 18px; }
}

/* 弹窗内 form-row 等分 */
.modal-form .form-row > .form-group { flex: 1; }

/* 移动端表格适配 - 强制撑开触发横向滚动 */
.player-table { min-width: 900px; }

/* ========== 详情弹窗 TAB ========== */
.detail-tabs {
  display: flex;
  border-bottom: 1px solid rgba(0,255,136,0.2);
  margin-bottom: 18px;
}
.dtab {
  padding: 10px 22px;
  font-size: 14px;
  color: #8a9aa9;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.25s;
  user-select: none;
}
.dtab:hover { color: #00ff88; }
.dtab.active {
  color: #00ff88;
  border-bottom-color: #00ff88;
  font-weight: bold;
}

/* 详情网格 */
.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 20px;
}
.info-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.info-item.full { grid-column: 1 / -1; }
.info-label {
  font-size: 12px;
  color: #5a6a7a;
  letter-spacing: 0.5px;
}
.info-val {
  font-size: 14px;
  color: #c8d1d9;
  background: #0f1620;
  padding: 8px 12px;
  border-radius: 5px;
  border: 1px solid rgba(0,255,136,0.15);
  word-break: break-all;
}
.info-val.uid { color: #00bfff; font-family: monospace; }
.info-val.remark {
  white-space: pre-wrap;
  min-height: 60px;
  line-height: 1.7;
}

/* 分页 */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 15px;
  flex-wrap: wrap;
}
.page-btn {
  min-width: 32px;
  height: 32px;
  padding: 0 10px;
  background: #0f1620;
  border: 1px solid rgba(0,255,136,0.25);
  color: #c8d1d9;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s;
  font-family: inherit;
}
.page-btn:hover:not(:disabled):not(.active) {
  border-color: #00ff88;
  color: #00ff88;
}
.page-btn.active {
  background: rgba(0,255,136,0.15);
  border-color: #00ff88;
  color: #00ff88;
  font-weight: bold;
}
.page-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}
.page-info {
  font-size: 12px;
  color: #5a6a7a;
  margin-left: 8px;
}
.loading { text-align: center; color: #5a6a7a; padding: 20px; }

/* 移动端详情网格单列 */
@media (max-width: 768px) {
  .info-grid { grid-template-columns: 1fr; }
}


/* 玩家列表列宽约束 */
.player-table { table-layout: auto; }
.player-table th:nth-child(2) { width: 15%; }
.player-table th:nth-child(3) { width: 15%; }
.player-table th:nth-child(4) { width: 15%; }
.player-table th:nth-child(5), .player-table td:nth-child(5) { width: 150px; min-width: 150px; max-width: 150px; }
.player-table th:nth-child(6), .player-table td:nth-child(6) { width: 150px; min-width: 150px; max-width: 150px; }
.player-table td.ops { white-space: nowrap; }
