/* 军团积分管理系统样式文件 */
/* 作者：系统重构 */
/* 日期：2024-01-15 */

/* ===== 全局样式 ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

body {
  background: #050a1a;
  background-image:
    radial-gradient(circle at 10% 20%, rgba(60, 80, 150, 0.4) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(100, 120, 255, 0.3) 0%, transparent 40%);
  color: #e6edf3;
  min-height: 100vh;
}

/* ===== 导航栏样式 ===== */
.navbar {
  background: rgba(15, 25, 50, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(100, 140, 255, 0.2);
  padding: 0 20px;
  position: sticky;
  top: 0;
  z-index: 999;
}

.nav-wrap {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.nav-logo {
  font-size: 18px;
  font-weight: 600;
  color: #fff;
  flex-shrink: 0;
}

.nav-items {
  display: flex;
  gap: 10px;
  flex-grow: 1;
  margin-left: 30px;
}

.nav-items button {
  background: transparent;
  border: none;
  color: #a0b4d8;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  transition: 0.2s;
}

.nav-items button.active {
  background: rgba(100, 140, 255, 0.2);
  color: #c9ddff;
}

.nav-items button:hover {
  color: #fff;
}

.login-container {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.login-status {
  font-size: 12px;
  color: #8892b0;
  padding: 4px 8px;
  background: rgba(100, 140, 255, 0.1);
  border-radius: 4px;
  border: 1px solid rgba(100, 140, 255, 0.2);
  flex-shrink: 0;
}

.login-form {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}

.login-form input {
  padding: 6px 10px;
  border: 1px solid rgba(100, 140, 255, 0.3);
  border-radius: 4px;
  background: rgba(15, 25, 50, 0.8);
  color: #e6edf3;
  font-size: 12px;
  width: 100px;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.login-form input:focus {
  outline: none;
  border-color: #6495ed;
  box-shadow: 0 0 0 2px rgba(100, 149, 237, 0.2);
}

.login-form button {
  padding: 6px 12px;
  background: linear-gradient(135deg, #6495ed, #4169e1);
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.login-form button:hover {
  background: linear-gradient(135deg, #4169e1, #1e90ff);
  transform: translateY(-1px);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.welcome-text {
  font-size: 12px;
  color: #6495ed;
  font-weight: 500;
  flex-shrink: 0;
}

.logout-btn {
  padding: 4px 8px;
  background: rgba(255, 84, 102, 0.1);
  color: #ff5466;
  border: 1px solid rgba(255, 84, 102, 0.3);
  border-radius: 4px;
  font-size: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.logout-btn:hover {
  background: rgba(255, 84, 102, 0.2);
  border-color: #ff5466;
}

.user-info-display {
  padding: 8px 12px;
  background: rgba(100, 140, 255, 0.1);
  border: 1px solid rgba(100, 140, 255, 0.3);
  border-radius: 4px;
  color: #6495ed;
  font-size: 14px;
  font-weight: 500;
  text-align: center;
  min-width: 120px;
  transition: all 0.3s ease;
}

.user-info-display.logged-in {
  background: rgba(100, 140, 255, 0.2);
  border-color: #6495ed;
  color: #fff;
}

.user-info-display.admin {
  background: rgba(255, 165, 0, 0.2);
  border-color: #ffa500;
  color: #ffa500;
}

.user-info-display.super-admin {
  background: rgba(255, 107, 107, 0.2);
  border-color: #ff6b6b;
  color: #ff6b6b;
  text-shadow: 0 0 5px rgba(255, 107, 107, 0.5);
}

.current-user-row {
  background: rgba(100, 140, 255, 0.2);
  border-left: 4px solid #6495ed;
  font-weight: bold;
}

.current-user-row td {
  color: #c9ddff;
}

.current-user-point {
  background: linear-gradient(135deg, rgba(100, 149, 237, 0.2), rgba(65, 105, 225, 0.2));
  border: 1px solid rgba(100, 149, 237, 0.4);
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 16px;
  font-weight: 600;
  color: #c9ddff;
  box-shadow: 0 4px 12px rgba(100, 149, 237, 0.1);
}

.current-user-point .point-value {
  font-size: 20px;
  font-weight: bold;
  color: #6495ed;
}

.user-info-box {
  background: rgba(100, 140, 255, 0.2);
  border: 1px solid rgba(100, 140, 255, 0.3);
  border-radius: 6px;
  padding: 12px;
  margin-bottom: 15px;
}

.user-name {
  display: block;
  font-size: 16px;
  font-weight: bold;
  color: #c9ddff;
  margin-bottom: 5px;
}

.user-point {
  display: block;
  font-size: 14px;
  color: #a0b4d8;
}

.admin-user-select {
  padding: 8px 12px;
  background: rgba(15, 25, 50, 0.8);
  border: 1px solid rgba(100, 140, 255, 0.3);
  border-radius: 4px;
  color: #e6edf3;
  font-size: 14px;
  min-width: 150px;
  transition: all 0.3s ease;
}

/* ===== 管理员栏样式 ===== */
.admin-bar {
  max-width: 1200px;
  margin: 12px auto;
  padding: 0 20px;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  align-items: center;
}

.admin-bar input {
  width: 120px;
  padding: 6px 10px;
  border-radius: 6px;
  background: rgba(20,30,60,0.6);
  border: 1px solid rgba(100,140,255,0.3);
  color: #fff;
  outline: none;
}

.admin-bar button {
  padding: 6px 12px;
  border-radius: 6px;
  background: linear-gradient(90deg, #4060ff, #6090ff);
  color: #fff;
  border: none;
  cursor: pointer;
}

.admin-status {
  font-size: 13px;
  color: #a0b4d8;
}

/* ===== 容器样式 ===== */
.container {
  max-width: 1200px;
  margin: 10px auto 40px;
  padding: 0 20px;
}

/* ===== 页面切换样式 ===== */
.page {
  display: none;
}

.page.active {
  display: block;
}

/* ===== 网格布局样式 ===== */
.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.card {
  background: rgba(15, 25, 50, 0.7);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(100, 140, 255, 0.2);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 8px 24px rgba(0, 10, 40, 0.15);
  height: 100%;
  display: flex;
  flex-direction: column;
}

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

.card h2 {
  font-size: 19px;
  margin-bottom: 16px;
  color: #c9ddff;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ===== 表单样式 ===== */
.form-group {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

input, select, textarea {
  flex: 1;
  min-width: 120px;
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid rgba(120, 160, 255, 0.3);
  background: rgba(20, 30, 60, 0.6);
  color: #fff;
  outline: none;
  font-size: 14px;
}

input:focus, select:focus, textarea:focus {
  border-color: #6495ed;
  box-shadow: 0 0 0 2px rgba(100, 149, 237, 0.2);
}

textarea {
  resize: vertical;
  min-height: 60px;
}

/* ===== 按钮样式 ===== */
button {
  padding: 8px 14px;
  border-radius: 6px;
  border: none;
  background: linear-gradient(90deg, #4060ff, #6090ff);
  color: #fff;
  cursor: pointer;
  font-weight: 500;
  transition: 0.2s;
  white-space: nowrap;
  font-size: 14px;
}

button:hover {
  background: linear-gradient(90deg, #5070ff, #70a0ff);
  transform: translateY(-1px);
}

.btn-red {
  background: linear-gradient(90deg, #ff4060, #ff7080);
}

.btn-green {
  background: linear-gradient(90deg, #28c76f, #44ce83);
}

.btn-sm {
  padding: 5px 10px;
  font-size: 12px;
}

.btn-apply {
  padding: 10px 20px;
  border-radius: 6px;
  border: none;
  background: linear-gradient(90deg, #36d399, #3ac2b2);
  color: #fff;
  font-weight: 500;
  cursor: pointer;
  transition: 0.2s;
}

.btn-apply:hover {
  background: linear-gradient(90deg, #42e9ab, #42d3c2);
  transform: translateY(-1px);
}

.btn-exchange {
  padding: 8px 16px;
  border-radius: 6px;
  border: none;
  background: linear-gradient(90deg, #6495ed, #4169e1);
  color: #fff;
  font-weight: 500;
  cursor: pointer;
  transition: 0.2s;
}

.btn-exchange:hover {
  background: linear-gradient(90deg, #4169e1, #1e90ff);
  transform: translateY(-1px);
}

/* ===== 权限控制样式 ===== */
.locked .btn-green, 
.locked .btn-red, 
.locked .btn-sm, 
.locked button:not(.btn-apply):not(.btn-exchange) {
  opacity: 0.5 !important;
  pointer-events: none !important;
}

/* ===== 用户列表样式 ===== */
.user-list {
  max-height: 380px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-right: 4px;
  margin-top: 12px;
}

.user-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  background: rgba(25, 40, 80, 0.4);
  border-radius: 6px;
  font-size: 14px;
  transition: all 0.2s ease;
}

.user-item:hover {
  background: rgba(25, 40, 80, 0.6);
  transform: translateY(-1px);
}

.user-name {
  font-weight: 500;
  color: #fff;
  flex-grow: 1;
}

.user-points {
  background: rgba(100, 140, 255, 0.2);
  color: #9cc9ff;
  padding: 3px 8px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
}

/* ===== 日志样式 ===== */
.logs {
  margin-top: 12px;
  max-height: 200px;
  overflow-y: auto;
  font-size: 12px;
  color: #9cb6e3;
  gap: 6px;
  display: flex;
  flex-direction: column;
  padding: 10px;
  background: rgba(25, 40, 80, 0.3);
  border-radius: 6px;
  border: 1px solid rgba(100, 140, 255, 0.1);
}

/* ===== 奖励网格样式 ===== */
.gift-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.gift {
  background: rgba(25, 40, 80, 0.5);
  border-radius: 10px;
  padding: 12px;
  text-align: center;
  position: relative;
  border: 1px solid rgba(120, 160, 255, 0.2);
  transition: all 0.2s ease;
}

.gift:hover {
  background: rgba(25, 40, 80, 0.7);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 10, 40, 0.2);
}

.gift-img {
  width: 100%;
  height: 100px;
  object-fit: cover;
  border-radius: 6px;
  margin-bottom: 10px;
  background: rgba(100, 140, 255, 0.1);
}

.gift-name {
  font-weight: 500;
  margin-bottom: 6px;
  color: #fff;
  font-size: 14px;
  line-height: 1.2;
}

.gift-point {
  display: inline-block;
  padding: 3px 8px;
  background: rgba(100, 140, 255, 0.2);
  color: #9cc9ff;
  font-size: 11px;
  border-radius: 10px;
  font-weight: 600;
}

.gift-delete {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(25, 40, 80, 0.8);
  border: 1px solid rgba(120, 160, 255, 0.3);
  color: #a0b4d8;
  font-size: 11px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.gift-delete:hover {
  background: rgba(255, 80, 110, 0.2);
  border-color: rgba(255, 120, 140, 0.4);
  color: #ff99aa;
  transform: scale(1.08);
}

/* ===== 表格卡片样式 ===== */
.table-card {
  background: rgba(15, 25, 50, 0.7);
  backdrop-filter: blur(10px);
  border-radius: 16px;
  padding: 28px 24px;
  border: 1px solid rgba(100, 140, 255, 0.2);
}

.table-card h2 {
  font-size: 20px;
  margin-bottom: 24px;
  color: #c9ddff;
}

.table-input-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.table-input-bar input {
  flex: 1;
  min-width: 140px;
}

/* ===== 数据表格样式 ===== */
.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.data-table th {
  padding: 14px 12px;
  border-bottom: 1px solid rgba(100, 140, 255, 0.2);
  color: #c9ddff;
  font-weight: 600;
  white-space: nowrap;
}

.data-table td {
  padding: 12px 12px;
  border-bottom: 1px solid rgba(100, 140, 255, 0.1);
  vertical-align: middle;
}

.data-table tr:hover td {
  background: rgba(25, 40, 80, 0.3);
}

/* ===== 状态标签样式 ===== */
.status {
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.status-wait { 
  background: rgba(255, 193, 7, 0.2); 
  color: #ffc107; 
}

.status-done { 
  background: rgba(40, 199, 111, 0.2); 
  color: #28c76f; 
}

.status-refuse { 
  background: rgba(255, 84, 102, 0.2); 
  color: #ff5466; 
}

.action-buttons {
  display: flex;
  gap: 6px;
}

/* ===== 原因文本样式 ===== */
.reason-td {
  max-width: 180px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  position: relative;
  cursor: pointer;
  word-break: break-all;
}

.reason-td:hover::after {
  content: attr(title);
  position: absolute;
  left: 0;
  top: calc(100% + 6px);
  min-width: 260px;
  max-width: 360px;
  background: rgba(15, 25, 50, 0.97);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(100, 140, 255, 0.3);
  border-radius: 10px;
  padding: 10px 14px;
  color: #e6edf3;
  font-size: 13px;
  white-space: normal;
  word-break: break-all;
  z-index: 99;
  box-shadow: 0 6px 20px rgba(0,0,0,0.25);
}

.rule-content {
  background: rgba(25, 40, 80, 0.5);
  border: 1px solid rgba(100, 140, 255, 0.2);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
  line-height: 1.6;
  white-space: pre-wrap;
}

.rule-edit-section {
  margin-top: 20px;
}

.rule-edit-section textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid rgba(120, 160, 255, 0.3);
  border-radius: 6px;
  background: rgba(20, 30, 60, 0.6);
  color: #fff;
  font-size: 14px;
  resize: vertical;
}

.rule-edit-section textarea:focus {
  border-color: #6495ed;
  box-shadow: 0 0 0 2px rgba(100, 149, 237, 0.2);
}

.seal {
  position: relative;
  display: inline-block;
  margin-left: 10px;
  transform: rotate(-20deg);
  vertical-align: middle;
}

.seal img {
  width: 40px;
  height: 40px;
  opacity: 0.7;
}

/* ===== 响应式设计 ===== */
@media (max-width: 768px) {
  .grid {
    grid-template-columns: 1fr;
  }
  
  .nav-wrap {
    flex-direction: column;
    height: auto;
    padding: 10px 0;
    gap: 10px;
  }
  
  .nav-items {
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .admin-bar {
    flex-direction: column;
    align-items: stretch;
  }
  
  .admin-bar input {
    width: 100%;
  }
  
  .form-group {
    flex-direction: column;
    align-items: stretch;
  }
  
  .gift-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }
  
  .rule-content {
    padding: 15px;
  }
  
  .rule-edit-section textarea {
    height: 200px;
  }
}