* {margin:0;padding:0;box-sizing:border-box;} /* 基础样式重置 */
:root {
  --primary-color: #3f51b5;
  --primary-light: #e8eaf6;
  --primary-dark: #303f9f;
  --secondary-color: #ff4081;
  --success-color: #4caf50;
  --danger-color: #f44336;
  --warning-color: #ff9800;
  --text-color: #333;
  --text-light: #757575;
  --bg-color: #f5f6fa;
  --card-color: #fff;
  --border-color: #e0e0e0;
  --border-radius: 8px;
  --shadow: 0 4px 12px rgba(0,0,0,0.1);
  --transition: all 0.3s ease;
}
body {
  font-family:"Microsoft YaHei",sans-serif;
  background:var(--bg-color);
  padding:20px;
  color:var(--text-color);
  line-height:1.6;
}
.container {
  max-width:1000px;
  margin:0 auto;
  background:var(--card-color);
  border-radius:var(--border-radius);
  box-shadow:var(--shadow);
  padding:30px;
  position:relative;
  overflow:hidden;
}
.container::before {
  content:"";
  position:absolute;
  top:0;
  left:0;
  width:100%;
  height:5px;
  background:var(--primary-color);
}
.header {
  text-align:center;
  margin-bottom:30px;
}
.header h1 {
  color:var(--primary-color);
  font-size:32px;
  position:relative;
  padding-bottom:15px;
}
.header h1::after {
  content:"";
  position:absolute;
  bottom:0;
  left:50%;
  transform:translateX(-50%);
  width:80px;
  height:3px;
  background:var(--primary-color);
}
.tab-buttons {
  display:flex;
  justify-content:center;
  margin-bottom:30px;
}
.tab-btn {
  padding:12px 25px;
  cursor:pointer;
  background:var(--bg-color);
  margin-right:5px;
  border-radius:var(--border-radius) var(--border-radius) 0 0;
  transition:var(--transition);
  font-weight:bold;
  display:flex;
  align-items:center;
  color:var(--text-light);
}
.tab-btn:hover {
  background:var(--primary-light);
  color:var(--primary-dark);
}
.tab-btn.active {
  background:var(--primary-color);
  color:#fff;
}
.tab-content {
  display:none;
}
.tab-content.active {
  display:block;
  animation:fadeIn 0.3s;
}
@keyframes fadeIn {
  from {opacity:0; transform:translateY(10px);}
  to {opacity:1; transform:translateY(0);}
}
.search-box {
  display:flex;
  margin-bottom:25px;
  position:relative;
}
#search {
  flex:1;
  padding:12px 20px;
  border:2px solid var(--border-color);
  border-radius:var(--border-radius);
  font-size:16px;
  transition:var(--transition);
  box-shadow:0 2px 5px rgba(0,0,0,0.05);
}
#search:focus {
  border-color:var(--primary-color);
  box-shadow:0 0 0 3px rgba(63,81,181,0.2);
  outline:none;
}
#search-btn {
  padding:12px 25px;
  background:var(--primary-color);
  color:#fff;
  border:none;
  border-radius:var(--border-radius);
  margin-left:10px;
  cursor:pointer;
  font-weight:bold;
  transition:var(--transition);
  display:flex;
  align-items:center;
  justify-content:center;
}
#search-btn:hover {
  background:var(--primary-dark);
  transform:translateY(-2px);
}
#search-btn i {
  margin-right:6px;
}
.filters {
  display:flex;
  gap:15px;
  margin-bottom:25px;
  flex-wrap:wrap;
  background:var(--primary-light);
  padding:15px;
  border-radius:var(--border-radius);
}
.filter-item {
  display:flex;
  align-items:center;
}
.filter-item label {
  margin-right:10px;
  font-weight:bold;
  color:var(--primary-dark);
}
.filter-item select {
  padding:8px 15px;
  border-radius:var(--border-radius);
  border:1px solid var(--border-color);
  background:#fff;
  cursor:pointer;
  font-size:14px;
  transition:var(--transition);
}
.filter-item select:focus {
  border-color:var(--primary-color);
  box-shadow:0 0 0 3px rgba(63,81,181,0.2);
  outline:none;
}
#results {
  margin-top:25px;
  border-radius:var(--border-radius);
  overflow:hidden;
  box-shadow:0 2px 8px rgba(0,0,0,0.08);
}
table {
  width:100%;
  border-collapse:collapse;
  text-align:left;
  background:#fff;
}
th, td {
  padding:15px;
  border-bottom:1px solid var(--border-color);
}
th {
  background:var(--primary-color);
  color:#fff;
  position:sticky;
  top:0;
  font-weight:bold;
}
tr:hover {
  background:var(--primary-light);
}
tr:last-child td {
  border-bottom:none;
}
.no-result {
  text-align:center;
  padding:50px 20px;
  color:var(--text-light);
  font-size:16px;
}
.stats {
  margin-top:20px;
  text-align:right;
  color:var(--text-light);
  font-size:14px;
  background:var(--primary-light);
  padding:10px 15px;
  border-radius:var(--border-radius);
}
.replace-box {
  margin-bottom:30px;
}
.replace-box h3 {
  color:var(--primary-color);
  margin-bottom:15px;
  font-size:22px;
}
.replace-box p {
  color:var(--text-light);
  margin-bottom:20px;
}
.replace-row {
  display:flex;
  gap:20px;
  margin-bottom:30px;
}
.replace-col {
  flex:1;
  background:#fff;
  border-radius:var(--border-radius);
  box-shadow:0 2px 8px rgba(0,0,0,0.08);
  padding:20px;
  position:relative;
}
.replace-col h4 {
  margin-bottom:15px;
  color:var(--primary-dark);
  display:flex;
  align-items:center;
}
.replace-col h4 i {
  margin-right:8px;
}
.replace-search {
  width:100%;
  padding:12px 15px;
  border:2px solid var(--border-color);
  border-radius:var(--border-radius);
  margin-bottom:15px;
  font-size:15px;
  transition:var(--transition);
}
.replace-search:focus {
  border-color:var(--primary-color);
  box-shadow:0 0 0 3px rgba(63,81,181,0.2);
  outline:none;
}
.replace-list {
  max-height:250px;
  overflow-y:auto;
  border:1px solid var(--border-color);
  border-radius:var(--border-radius);
  background:#f9f9f9;
}
.replace-item {
  padding:12px 15px;
  cursor:pointer;
  border-bottom:1px solid var(--border-color);
  transition:var(--transition);
}
.replace-item:last-child {
  border-bottom:none;
}
.replace-item:hover {
  background:#f0f7ff;
}
.replace-item.selected {
  background:var(--primary-light);
  font-weight:bold;
  border-left:3px solid var(--primary-color);
}
.replace-item .item-id {
  color:var(--primary-color);
  font-weight:bold;
}
.replace-rules {
  margin-top:30px;
  border:1px solid var(--border-color);
  border-radius:var(--border-radius);
  padding:20px;
  background:#f9f9f9;
}
.replace-rules h4 {
  margin-bottom:20px;
  color:var(--primary-dark);
  display:flex;
  align-items:center;
  justify-content:space-between;
}
.replace-rule {
  display:flex;
  gap:15px;
  margin-bottom:15px;
  align-items:center;
  background:#fff;
  padding:10px;
  border-radius:var(--border-radius);
  box-shadow:0 2px 5px rgba(0,0,0,0.05);
  transition:var(--transition);
}
.replace-rule:hover {
  box-shadow:0 5px 15px rgba(0,0,0,0.08);
  transform:translateY(-2px);
}
.replace-arrow {
  color:var(--primary-color);
  flex-shrink:0;
  font-size:20px;
}
.replace-action {
  flex-shrink:0;
}
.replace-rule-item {
  flex:1;
  padding:12px;
  border:1px solid var(--border-color);
  border-radius:var(--border-radius);
  background:#fff;
}
.replace-rule-item .item-id {
  color:var(--primary-color);
  font-weight:bold;
}
#replace-btn {
  padding:12px 25px;
  background:var(--secondary-color);
  color:#fff;
  border:none;
  border-radius:var(--border-radius);
  margin-top:20px;
  cursor:pointer;
  font-weight:bold;
  transition:var(--transition);
  display:flex;
  align-items:center;
  justify-content:center;
  width:100%;
  max-width:300px;
  margin:20px auto 0;
}
#replace-btn:hover {
  background:#e91e63;
  transform:translateY(-2px);
}
#replace-btn i {
  margin-right:8px;
}
#replace-result {
  margin-top:30px;
  padding:20px;
  border:1px solid var(--border-color);
  border-radius:var(--border-radius);
  background:#fff;
  display:none;
  animation:fadeIn 0.3s;
}
#replace-result h4 {
  color:var(--primary-dark);
  margin-bottom:15px;
  padding-bottom:10px;
  border-bottom:1px solid var(--border-color);
}
.replace-options {
  margin:20px 0;
  display:flex;
  align-items:center;
  background:var(--primary-light);
  padding:15px;
  border-radius:var(--border-radius);
}
.replace-options label {
  margin-right:10px;
  display:flex;
  align-items:center;
  cursor:pointer;
}
.replace-options input[type="checkbox"] {
  margin-right:8px;
  width:18px;
  height:18px;
  cursor:pointer;
}
.selected-none {
  color:var(--text-light);
  font-style:italic;
}
.btn-add {
  padding:8px 15px;
  background:var(--success-color);
  color:#fff;
  border:none;
  border-radius:var(--border-radius);
  cursor:pointer;
  font-weight:bold;
  transition:var(--transition);
  display:flex;
  align-items:center;
}
.btn-add:hover {
  background:#388e3c;
  transform:translateY(-2px);
}
.btn-add i {
  margin-right:5px;
}
.btn-remove {
  padding:5px 10px;
  background:var(--danger-color);
  color:#fff;
  border:none;
  border-radius:var(--border-radius);
  cursor:pointer;
  margin-left:5px;
  transition:var(--transition);
  display:flex;
  align-items:center;
  justify-content:center;
}
.btn-remove:hover {
  background:#d32f2f;
}
.btn-remove i {
  font-size:16px;
}
.btn-copy {
  padding:5px 10px;
  background:var(--primary-color);
  color:#fff;
  border:none;
  border-radius:var(--border-radius);
  cursor:pointer;
  margin-left:10px;
  font-size:14px;
  transition:var(--transition);
  display:inline-flex;
  align-items:center;
}
.btn-copy:hover {
  background:var(--primary-dark);
  transform:translateY(-2px);
}
.btn-copy i {
  margin-right:5px;
}
@media (max-width: 768px) {
  .container {
    padding:15px 10px;
    margin:10px;
    width:calc(100% - 20px);
  }
  .header h1 {
    font-size:24px;
    padding-bottom:10px;
  }
  .replace-row {
    flex-direction:column;
  }
  .replace-col {
    margin-bottom:15px;
  }
  .filters {
    flex-direction:column;
    align-items:stretch;
  }
  .filter-item {
    margin-bottom:10px;
  }
  .tab-buttons {
    flex-wrap:wrap;
    gap:5px;
  }
  .tab-btn {
    padding:8px 12px;
    font-size:14px;
    margin-right:0;
    flex:1;
    justify-content:center;
    white-space:nowrap;
    min-width:100px;
  }
  .search-box {
    flex-direction:column;
    gap:10px;
  }
  #search-btn {
    margin-left:0;
    width:100%;
  }
  th, td {
    padding:8px 6px;
    font-size:13px;
  }
  .replace-rule {
    flex-wrap:wrap;
    gap:8px;
  }
  .replace-rule-item {
    flex:100%;
  }
  .replace-arrow {
    flex:100%;
    text-align:center;
    transform:rotate(90deg);
    margin:5px 0;
  }
  .replace-action {
    width:100%;
    display:flex;
    justify-content:flex-end;
  }
  #replace-btn {
    width:100%;
    max-width:100%;
  }
  #replace-result h4 {
    display:flex;
    flex-direction:column;
    align-items:flex-start;
    gap:10px;
  }
  .btn-copy {
    margin:5px 0 0 0;
  }
  table {
    display:block;
    overflow-x:auto;
    white-space:nowrap;
  }
  .faq-answer {
    overflow:visible;
    word-break:break-word;
  }
  .faq-answer pre {
    white-space:pre-wrap;
    word-wrap:break-word;
    overflow-x:auto;
    font-size:13px;
  }
  .faq-item h4 {
    padding:12px 10px;
    font-size:15px;
    line-height:1.4;
  }
  .faq-item h4 i {
    margin-right:8px;
    font-size:16px;
    flex-shrink:0;
  }
  .faq-answer ol {
    padding-left:15px;
  }
  .faq-answer ol li {
    margin-bottom:12px;
  }
  /* 触摸友好的样式 */
  .replace-item, .btn-remove, .btn-add, .btn-copy, #search-btn, #replace-btn, .tab-btn {
    min-height:44px; /* 触摸友好的按钮尺寸 */
  }
  .replace-search, #search, .filter-item select {
    font-size:16px; /* 防止iOS自动缩放 */
    min-height:44px;
  }
}
/* 常见问题样式 */
.faq-container {
  padding: 10px 0;
}
.faq-container h3 {
  margin-bottom: 20px;
  color: var(--primary-color);
  font-size: 22px;
}
.faq-item {
  margin-bottom: 20px;
  background: #fff;
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.faq-item h4 {
  padding: 15px;
  background: var(--primary-light);
  color: var(--primary-dark);
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background-color 0.3s;
  position: relative;
}
.faq-item h4:hover {
  background: #dde1f8; /* 略微深一点的背景色 */
}
.faq-item h4::after {
  content: "\ea4e";
  font-family: remixicon;
  transition: transform 0.3s;
  color: var(--primary-color);
  font-size: 20px;
}
.faq-item h4.active::after {
  transform: rotate(180deg);
}
.faq-item h4 i {
  margin-right: 10px;
  font-size: 18px;
}
.faq-answer {
  padding: 15px;
  border-top: 1px solid var(--border-color);
  max-height: 1000px; /* 添加一个足够大的初始高度值 */
  overflow: hidden;
  transition: max-height 0.5s ease;
}
.faq-answer.active {
  display: block !important;
  height: auto !important;
  max-height: 2000px !important; /* 使用足够大的值确保内容能完全显示 */
}
.faq-answer p {
  margin-bottom: 10px;
}
.faq-answer pre {
  background: #f5f5f5;
  padding: 10px;
  border-radius: 5px;
  font-family: monospace;
  margin: 10px 0;
}
.faq-answer ol {
  padding-left: 20px;
}
.faq-answer ol li {
  margin-bottom: 15px;
}
.faq-answer ol li strong {
  color: var(--primary-dark);
  display: block;
  margin-bottom: 5px;
}

/* 动画效果 */
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* 确保FAQ默认能显示的额外规则 */
#faq-content .faq-answer {
  max-height: 2000px !important;
  display: block !important;
  opacity: 1 !important;
  visibility: visible !important;
}

@media screen and (max-width: 768px) {
  .container {
    padding: 15px 10px;
    margin: 10px;
  }
  
  h1 {
    font-size: 24px;
  }
  
  table {
    font-size: 13px;
    overflow-x: auto;
    display: block;
    width: 100%;
  }
  
  .tab-btn {
    min-height: 44px;
    padding: 10px 15px;
  }
  
  .search-box {
    flex-direction: column;
    align-items: stretch;
  }
  
  .search-box input {
    margin-right: 0;
    margin-bottom: 10px;
    min-height: 40px;
    font-size: 16px;
  }
  
  .search-box select {
    margin-right: 0;
    margin-bottom: 10px;
    min-height: 40px;
    font-size: 16px;
  }
  
  #search-btn, #replace-btn, .btn-copy {
    min-height: 44px;
    font-size: 16px;
  }
  
  .replacement-rule {
    flex-direction: column;
    padding: 10px;
  }
  
  .weapon-card {
    width: 100%;
    margin: 5px 0;
  }
  
  .faq-header {
    padding: 12px;
    font-size: 16px;
  }
  
  /* 添加触摸反馈效果 */
  .touch-device .touch-active {
    transform: scale(0.97);
    opacity: 0.9;
    transition: transform 0.15s ease-in-out, opacity 0.15s ease-in-out;
  }
  
  .touch-device .tab-btn, 
  .touch-device .btn-add, 
  .touch-device .btn-remove, 
  .touch-device .btn-copy, 
  .touch-device #search-btn, 
  .touch-device #replace-btn {
    transition: transform 0.2s ease-in-out, opacity 0.2s ease-in-out, background-color 0.2s ease-in-out;
  }
  
  /* 增强触摸区域大小 */
  .touch-device .tab-btn,
  .touch-device .faq-header,
  .touch-device #search-btn,
  .touch-device #replace-btn,
  .touch-device .btn-copy {
    position: relative;
  }
  
  .touch-device .tab-btn::after,
  .touch-device .faq-header::after,
  .touch-device #search-btn::after,
  .touch-device #replace-btn::after,
  .touch-device .btn-copy::after {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    z-index: -1;
  }
} 