/* 工具模块 */
.tools-module {
  padding: 20px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
  min-height: 500px;
}

.tools-layout {
  display: flex;
  gap: 20px;
  height: calc(100vh - 200px);
}

.tools-sidebar {
  width: 200px;
  background: #f5f7fa;
  border-radius: 8px;
  padding: 20px 0;
}

.tools-sidebar h3 {
  margin: 0 0 15px 0;
  padding: 0 20px;
  font-size: 16px;
  color: #303133;
}

.tools-menu {
  list-style: none;
  padding: 0;
  margin: 0;
}

.tools-menu li {
  padding: 12px 20px;
  cursor: pointer;
  color: #606266;
  transition: all 0.3s;
  border-left: 3px solid transparent;
}

.tools-menu li:hover {
  background: #e6e8eb;
  color: #667eea;
}

.tools-menu li.active {
  background: #ecf5ff;
  color: #667eea;
  border-left-color: #667eea;
  font-weight: 600;
}

.tools-content {
  flex: 1;
  background: #fff;
  border-radius: 8px;
  padding: 20px;
  overflow-y: auto;
}

.tool-panel {
  max-width: 900px;
  margin: 0 auto;
}

.tool-panel h2 {
  margin: 0 0 30px 0;
  color: #303133;
  font-size: 24px;
  border-bottom: 2px solid #667eea;
  padding-bottom: 15px;
}

.tool-options {
  display: flex;
  gap: 20px;
  align-items: flex-end;
  margin-bottom: 30px;
  padding: 20px;
  background: #f5f7fa;
  border-radius: 8px;
}

.option-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.option-group label {
  font-size: 14px;
  color: #606266;
  font-weight: 500;
}

.option-group select {
  padding: 10px 15px;
  border: 1px solid #dcdfe6;
  border-radius: 4px;
  font-size: 14px;
  background: white;
  min-width: 150px;
}

.option-group select:focus {
  border-color: #409eff;
  outline: none;
}

.btn-generate {
  padding: 10px 30px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.3s;
}

.btn-generate:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.key-length-info {
  margin-top: 10px;
  padding: 8px 12px;
  background: #f0f7ff;
  border-left: 3px solid #667eea;
  color: #667eea;
  font-size: 13px;
  font-weight: 600;
  border-radius: 4px;
}

.btn-generate:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.key-result {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-weight: 600;
  color: #555;
}

.btn-copy {
  padding: 6px 16px;
  background: rgba(102, 126, 234, 0.1);
  color: #667eea;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.2s;
}

.btn-copy:hover {
  background: rgba(102, 126, 234, 0.2);
  transform: translateY(-1px);
}

.key-info {
  margin-top: 20px;
  padding: 15px;
  background: #f0f7ff;
  border-radius: 8px;
  border-left: 4px solid #667eea;
}

.key-info p {
  margin: 8px 0;
  color: #555;
  font-size: 14px;
  line-height: 1.6;
}

.key-info p:last-child {
  margin-top: 12px;
  color: #667eea;
  font-weight: 500;
}

.form-tip {
  color: #909399;
  font-size: 12px;
  margin-top: 5px;
  display: block;
}

.result-section h4 {
  margin: 0 0 10px 0;
  color: #303133;
  font-size: 16px;
}

.result-section textarea {
  width: 100%;
  padding: 15px;
  border: 1px solid #dcdfe6;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  font-size: 13px;
  resize: vertical;
  background: #fafafa;
}

.result-section textarea:focus {
  border-color: #409eff;
  outline: none;
  background: #fff;
}

/* JSON 处理工具 */
.json-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.json-input-section h4,
.json-output-section h4 {
  margin: 0 0 10px 0;
  color: #303133;
  font-size: 16px;
}

.json-input-section textarea,
.json-output-section textarea {
  width: 100%;
  padding: 15px;
  border: 1px solid #dcdfe6;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  font-size: 13px;
  resize: vertical;
}

.json-input-section textarea:focus,
.json-output-section textarea:focus {
  border-color: #409eff;
  outline: none;
}

.json-actions {
  display: flex;
  gap: 10px;
}

.json-actions button {
  padding: 10px 20px;
  background: #667eea;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s;
}

.json-actions button:hover {
  background: #5568d3;
  transform: translateY(-2px);
}

.json-output-section .message {
  margin-top: 10px;
  padding: 10px 15px;
  border-radius: 4px;
  font-size: 14px;
}

.json-output-section .message.success {
  background: #f0f9ff;
  color: #667eea;
  border: 1px solid #b3d8ff;
}

.json-output-section .message.error {
  background: #fef0f0;
  color: #f56c6c;
  border: 1px solid #fde2e2;
}

/* 响应式 */
@media (max-width: 768px) {
  .tools-layout {
    flex-direction: column;
    height: auto;
  }
  
  .tools-sidebar {
    width: 100%;
  }
  
  .tool-options {
    flex-direction: column;
    align-items: stretch;
  }
  
  .option-group select {
    width: 100%;
  }
  
  .btn-generate {
    width: 100%;
  }
}