/* 全局样式 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei",
    Arial, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  background-attachment: fixed;
  line-height: 1.6;
  min-height: 100vh;
}

/* 头部样式 - 现代化玻璃态效果 */
.main-header {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  padding: 8px 0;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.header-content {
  max-width: 1520px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-content h1 {
  font-size: 24px;
  margin: 0;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 15px;
}

.user-info span {
  color: white;
}

/* 登录页面 - 现代化设计 */
.login-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 20px;
}

.login-box {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  padding: 50px 40px;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  width: 100%;
  max-width: 420px;
  animation: slideUp 0.6s ease-out;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.login-box h1 {
  text-align: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 10px;
  font-size: 32px;
  font-weight: 700;
}

.login-box h2 {
  text-align: center;
  color: #666;
  font-size: 16px;
  font-weight: 400;
  margin-bottom: 40px;
}

/* 工具页面容器 */
.tool-container {
  background-color: white;
  padding: 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  display: flex;
  gap: 20px;
}

.left-panel {
  width: 300px;
  flex-shrink: 0;
}

.right-panel {
  flex: 1;
  min-width: 0;
  overflow-x: auto;
}

/* 管理页面 - 现代化卡片设计 */
.admin-container {
  max-width: 100%;
  margin: 0;
  padding: 0;
  height: calc(100vh - 60px);
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px;
  overflow: hidden;
  box-sizing: border-box;
}

.admin-container h1 {
  display: none; /* 隐藏标题 */
}

/* 表单样式 - 现代化输入框 */
.form-group {
  margin-bottom: 10px; /* 更小间距 */
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  color: #333;
  font-size: 13px; /* 更小的标签 */
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 12px; /* 更紧凑 */
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 14px; /* 更小的输入框文字 */
  font-family: inherit;
  transition: all 0.3s ease;
  background: white;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
  transform: translateY(-1px);
}

.form-row {
  display: flex;
  gap: 12px;
  align-items: flex-end;
}

.form-row .form-group {
  flex: 1;
}

/* 按钮样式 - 现代化渐变按钮 */
.btn {
  padding: 8px 20px; /* 更小的按钮 */
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px; /* 更小的按钮文字 */
  font-weight: 600;
  text-decoration: none;
  display: inline-block;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
  width: 300px;
  height: 300px;
}

.btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.btn-secondary {
  background-color: #6c757d;
  color: white;
}

.btn-secondary:hover {
  background-color: #5a6268;
}

.btn-danger {
  background-color: #f44336;
  color: white;
}

.btn-danger:hover {
  background-color: #da190b;
}

.btn-block {
  width: 100%;
  display: block;
}

.btn-sm {
  padding: 5px 15px;
  font-size: 12px;
}

.btn-logout {
  background-color: #f44336;
}

.btn-logout:hover {
  background-color: #da190b;
}

.btn-edit {
  background-color: #2196f3;
  color: white;
}

.btn-edit:hover {
  background-color: #0b7dda;
}

/* 工具页面特有样式 */
.input-section {
  margin-bottom: 20px;
}

.input-section label {
  display: block;
  margin-bottom: 8px;
  font-weight: bold;
  color: #555;
  font-size: 14px;
}

textarea#dataInput {
  width: 100%;
  height: calc(100vh - 350px);
  min-height: 400px;
  padding: 10px;
  border: 2px solid #ddd;
  border-radius: 5px;
  font-size: 14px;
  font-family: "Consolas", monospace;
  resize: vertical;
}

.radio-group {
  display: flex;
  gap: 15px;
  margin: 10px 0;
}

.radio-group label {
  display: flex;
  align-items: center;
  cursor: pointer;
  font-weight: normal;
}

.radio-group input[type="radio"] {
  margin-right: 5px;
  cursor: pointer;
}

.button-group {
  display: flex;
  gap: 10px;
}

.btn-process {
  flex: 1;
  background-color: #4caf50;
  color: white;
  padding: 12px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 14px;
}

.btn-process:hover {
  background-color: #45a049;
}

.btn-clear {
  flex: 1;
  background-color: #f44336;
  color: white;
  padding: 12px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 14px;
}

.btn-clear:hover {
  background-color: #da190b;
}

/* 结果表格样式 - 现代化设计 */
.results {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
  font-size: 13px;
}

th,
td {
  padding: 10px 8px;
  text-align: center;
  border: none;
  border-bottom: 1px solid #f0f0f0;
}

th {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

tr:nth-child(even) {
  background-color: #fafafa;
}

tr:hover {
  background-color: #f5f5f5;
  transition: background-color 0.2s ease;
}

.label-cell {
  font-weight: 600;
  color: #333;
  text-align: left;
  background-color: rgba(102, 126, 234, 0.05);
}

.digit-cell {
  font-weight: 600;
  color: #667eea;
}

.match-highlight {
  background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%) !important;
  font-weight: 700;
  color: #333;
  box-shadow: 0 0 0 2px #ffd700;
}

.error-row {
  background-color: rgba(244, 67, 54, 0.1) !important;
}

.result-negative {
  color: #4caf50;
  font-weight: 700;
}

.result-positive {
  color: #f44336;
  font-weight: 700;
}

/* 统计框优化 */
.summary-box {
  padding: 15px 20px;
  background: linear-gradient(
    135deg,
    rgba(102, 126, 234, 0.1) 0%,
    rgba(118, 75, 162, 0.1) 100%
  );
  border-radius: 10px;
  border-left: 4px solid #667eea;
  margin-bottom: 15px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.summary-item {
  display: inline-block;
  margin-right: 25px;
  font-size: 14px;
}

.summary-label {
  font-weight: 600;
  color: #666;
}

.summary-value {
  font-weight: 700;
  font-size: 18px;
  margin-left: 8px;
}

.summary-value.positive {
  color: #f44336;
}

.summary-value.negative {
  color: #4caf50;
}

/* 卡片样式 - 现代化玻璃态卡片 */
.card {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  padding: 15px; /* 更紧凑 */
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  margin-bottom: 0; /* 移除底部边距 */
  border: 1px solid rgba(255, 255, 255, 0.3);
  transition: all 0.3s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

.card h2 {
  color: #333;
  margin-bottom: 10px; /* 减小间距 */
  font-size: 15px; /* 更小的标题 */
  font-weight: 600;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* 用户表格 - 现代化表格设计 */
.user-table {
  width: 100%;
  margin-top: 15px;
  border-radius: 10px;
  overflow: hidden;
  font-size: 13px; /* 更小的表格文字 */
}

.user-table th {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 12px 10px; /* 更紧凑 */
  font-weight: 600;
  text-transform: uppercase;
  font-size: 12px; /* 更小的表头 */
  letter-spacing: 0.3px;
}

.user-table td {
  text-align: center;
  padding: 10px 8px; /* 更紧凑 */
  border-bottom: 1px solid #f0f0f0;
  font-size: 13px; /* 更小的表格内容 */
}

.user-table tr:hover {
  background: rgba(102, 126, 234, 0.05);
}

/* 徽章 - 现代化标签 */
.badge {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.badge-admin {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(245, 87, 108, 0.3);
}

.badge-user {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(79, 172, 254, 0.3);
}

.badge-success {
  background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
  color: #333;
  box-shadow: 0 2px 8px rgba(168, 237, 234, 0.3);
}

.badge-danger {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(245, 87, 108, 0.3);
}

/* 提示消息 - 现代化提示框 */
.alert {
  padding: 12px 16px;
  margin-bottom: 20px;
  border-radius: 10px;
  border-left: 3px solid;
  animation: slideDown 0.4s ease-out;
  font-size: 14px;
  transition: all 0.3s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.alert-success {
  background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
  border-left-color: #28a745;
  color: #155724;
}

.alert-error {
  background: linear-gradient(135deg, #fee 0%, #fdd 100%);
  border-left-color: #dc3545;
  color: #721c24;
}

.alert p {
  margin: 0;
}

/* 模态框 */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
  background-color: white;
  margin: 5% auto;
  padding: 30px;
  border-radius: 8px;
  width: 90%;
  max-width: 500px;
  position: relative;
}

.close {
  position: absolute;
  right: 20px;
  top: 15px;
  font-size: 28px;
  font-weight: bold;
  color: #aaa;
  cursor: pointer;
}

.close:hover {
  color: #000;
}

.text-muted {
  color: #6c757d;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .tool-container {
    flex-direction: column;
  }

  .left-panel {
    width: 100%;
  }

  .form-row {
    flex-direction: column;
  }

  .header-content {
    flex-direction: column;
    gap: 10px;
  }

  .user-info {
    flex-wrap: wrap;
    justify-content: center;
  }
}
